Macro types: Letter: address of a memory location. Number: a 4-bit constant. Macros: %lda # *ldi a # *mov b a nop *jmp #### *not a *neg a *inc a *dec a *addi a # *subi a # *andi a # *ori a # *xori a # %stf %ldf *xnori a # *cmpi a # *test a *ijmp [a, a+1, a+2, a+3] *add a b *sub a b *cmp a b *and a b *or a b *xor a b *xnor a b *ld b a *st b a *imov a b *Memory-memory operations (designed for high-level programming) %Memory-register operations (designed for low-level programming) lda a LDI AR HIGH[a] PSH LDI AR MEDH[a] PSH LDI AR MEDL[a] PSH LDI AR LOW[a] nop NOP ldi a # lda a LDI C # ST C mov b a lda a LD C lda b ST C jmp a lda a MOV B A CMP BR.Z not a lda a LD A LDI B F XOR ST A neg a lda a LD B LDI A 0 SUB ST A inc a lda a LD A LDI B 1 ADD ST A dec a lda a LD A LDI B 1 SUB ST A addi a # lda a LD A LDI B # ADD ST A subi a # lda a LD A LDI B # SUB ST A andi a # lda a LD A LDI B # AND ST A ori a # lda a LD A LDI B # OR ST A xori a # lda a LD A LDI B # XOR ST A stf a lda a SWF ST A ldf a lda a LD A SWF xnori a # lda a LD A LDI B # XOR LDI B F XOR ST A cmpi a # lda a LD A LDI B # SUB test a lda a LD A LDI B 0 SUB ijmp [a+3 a+2 a+1 a] lda a LD A INC LD B INC LD C INC LD AR PSH MOV AR C PSH MOV AR B PSH MOV AR A MOV B A CMP BR.Z add a b lda b LD B lda a LD A ADD ST A sub a b lda b LD B lda a LD A SUB ST A cmp a b lda b LD B lda a LD A SUB and a b lda b LD B lda a LD A AND ST A or a b lda b LD B lda a LD A OR ST A xor a b lda b LD B lda a LD A XOR ST A xnor a b lda b LD B lda a LD A XOR LDI B F XOR ST A ld a [b+3 b+2 b+1 b] lda b LD A INC LD B INC LD C INC LD AR PSH MOV AR C PSH MOV AR B PSH MOV AR A LD A lda a ST A st [a+3 a+2 a+1 a] b lda b LD A SWF lda a LD A INC LD B INC LD C INC LD AR PSH MOV AR C PSH MOV AR B PSH MOV AR A SWF ST A imov [a+3 a+2 a+1 a] [b+3 b+2 b+1 b] lda b LD A INC LD B INC LD C INC LD AR PSH MOV AR C PSH MOV AR B PSH MOV AR A LD A SWF lda a LD A INC LD B INC LD C INC LD AR PSH MOV AR C PSH MOV AR B PSH MOV AR A SWF ST A